<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Welcome to MetaQue Bank</title>

    <!-- Bootstrap Core CSS -->
    <link href="/MetaQBank/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="/MetaQBank/css/sb-admin.css" rel="stylesheet">

    <!-- Morris Charts CSS -->
    <link href="/MetaQBank/css/plugins/morris.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="/MetaQBank/font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
	<script src="js/angular.min.js"></script>
	<script src="/MetaQBank/js/jquery.min.js"></script> 
	<script src="/MetaQBank/js/bootstrap.min.js"></script>
<script type="text/javascript" src = "/MetaQBank/js/metaqbank.js"></script>
	
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>
<body>
	<%

	String sessionMail = (String)session.getAttribute("sessionMail");%>

	<div class="container">
	
	
					<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				  <div class="modal-dialog">
				    <div class="modal-content">
				      <div class="modal-header">
				                <!-- The form is placed inside the body of modal -->
				                <form id="loginForm" action ="rest/login/userLogin" class="form-horizontal" method="post">
								 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
									<h2>Login</h2>
										<hr>
				                    <div class="form-group">
				                        <label class="col-md-3 control-label">Email</label>
				                        <div class="col-sm-5">
											<input type="email" name="eMail" class="form-control" pattern="[a-zA-Z0-9._-]+[@][a-z]+[.][a-z]+" id="loginEmail" placeholder="Email">
										</div>
				                    </div>
				                    <div class="form-group">
				                        <label class="col-md-3 control-label">Password</label>
				                        <div class="col-md-5">
				                            <input type="password" class="form-control" name="password" id="password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" placeholder="Password"/>
				                        </div>
				                    </div>
									<div class="form-group">
										<div class="col-sm-offset-2 col-sm-10">
											<div class="checkbox">
												<label>
													<input type="checkbox"> Keep me logged in
												</label>
											</div>
										</div>
									</div>
				                    <div class="form-group">
				                        <div class="col-md-5 col-md-offset-3">
				                            <button type="submit" class="btn btn-primary" id="login">Login</button><a href="#" >   Forgot Password </a>
				                        </div>
				                    </div>
									<hr>
									<div class="form-group">
										<div class="col-sm-offset-2 col-sm-10">
											<label>Use your <strong>Google</strong> account to login</label><br><br>
														<button type="submit" class="btn btn-primary" id="loginGoogle">Sign in with google</button>
										</div>
									</div>
				                </form>
				            </div>
				        </div>
						</div>
				        </div>
						
						
						<div class="modal fade" id="signup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						  <div class="modal-dialog">
						    <div class="modal-content">
						      <div class="modal-header">
						        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						        <h2 class="modal-title" id="myModalLabel">Need an Account? Sign up</h2>
						      </div>
						      <div class="modal-body">
						        <form class="form-horizontal" action = "rest/register/userRegister" role="form" method="post">
								<div class="form-group">
						  <label for="inputName" class="col-sm-3 control-label">Name</label>
						  <div class="col-sm-5">
						  <input type="text" class="form-control" id="name" name="name" pattern="[a-zA-Z]+" placeholder="Fullname">
						</div>
						</div>
						<br>
						  <div class="form-group">
						    <label for="inputEmail" class="col-sm-3 control-label">Email</label>
						    <div class="col-sm-5">
						      <input type="eMail" class="form-control" id="eMail" pattern="[a-zA-Z0-9._-]+[@][a-z]+[.][a-z]+" name ="eMail" placeholder="Email">
						    </div>
						  </div>
						<br>
						  <div class="form-group">
						    <label for="inputPassword" class="col-sm-3 control-label">Password</label>
						    <div class="col-sm-5">
						      <input type="password" class="form-control" id="signUppassword" name ="password"  pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" 
						      onchange="form.confirmPassword.pattern = this.value;" placeholder="Password">
						    </div>
						  </div>
						  <br>
						  <div class="form-group">
						    <label for="confirmPassword" class="col-sm-3 control-label">ConfirmPassword</label>
						    <div class="col-sm-5">
						      <input type="password" class="form-control" id="confirmPassword" name="confirmPassword" placeholder="Confirm Password">
						    </div>
						  </div>
						  <div class="form-group">
						    <div class="col-sm-offset-2 col-sm-10">
						      <button type="submit" class="btn btn-primary" id="signUp">Create an account </button>
						    </div>
						  </div>
						</form>
						      </div>
						      
						    </div>
						  </div>
						</div>
							
	
	<div class="row clearfix">
		<div class="col-md-12 column">
			<div class="row clearfix">
				<div class="col-md-12 column">
					<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
						<div class="navbar-header">
							 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="/MetaQBank/index.jsp">MetaQBank</a>
						</div>
						
						<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
							<ul class="nav navbar-nav">
								<li class="active">
									<a href="index.jsp">Home</a>
								</li>
								
								<li>
                        		<a href="#" class="dropdown-toggle" data-toggle="dropdown">Questions <span class="caret"></span></a>
		                        <ul class="dropdown-menu" role="menu">
		                            <li>
		                                <a href="../MetaQBank/recentQuestion.jsp">Recent Questions</a>
		                            </li>
		                            <li>
		                                <a href="#">Top 5 User's Questions</a>
		                            </li>
									<li>
		                                <a href="../MetaQBank/unAnsweredQuestion.jsp">Unanswered</a>
		                            </li>
									<li>
		                                <a href="#">Highly rated questions</a>
		                            </li>
									<%if(sessionMail!=null){ %>
									<li>
		                                <a href="#">My questions</a>
		                            </li>
									<li>
		                                <a href="#">Questions I answered</a>
		                            </li>
		                            <%} %>
		                            
		                            
		                            
		                        </ul>
                    			</li>
								<li>
									<a href="#">Users</a>
								</li>
								<li>
									<a href="#">Tags</a>
								</li>
								<li>
									<a href="#">Unanswered</a>
								</li>
								<li>
									<a href="#">About</a>
								</li>
							</ul>
							<form class="navbar-form navbar-left" role="search">
								<div class="input-group search" >
       <input type="Search" placeholder="Search Question..." class="form-control"/>
       <div class="input-group-btn ">
           <button class="btn btn-primary">
           <span class="glyphicon glyphicon-search"></span>
           </button>
       </div>
   </div>
							</form>
							
							
		
							<ul class="nav navbar-nav navbar-right">
						<%
	
	if(sessionMail == null) { %>
										<li>
											<a href="#" data-toggle="modal" data-target="#myModal">Login</a>
										</li>
										<li>
											<a href="#" data-toggle="modal" data-target="#signup">Sign up</a>
										</li><% 		
	}else{ 
	
	%>
									<li>
										<a href="#" class="dropdown-toggle" data-toggle="dropdown"><input type="hidden" /> <span class="caret"></span></a>
		                        <ul class="dropdown-menu" role="menu">
		                            <li>
		                                <a href="manageAccount.jsp">Manage Acount</a>
		                            </li>
		                            </ul>
									</li>
									
									<li>
									<a href="#" class = "btn btn-link" onclick = "respConfirm ()" > <i class="glyphicon glyphicon-user"></i> Logout</a>
                        
                   
					</li>
					<%} %>	
										
									</ul>
							
						</div>
						
					</nav>
				</div>
			</div>
		</div>
	</div>
	<div class="row" style="height:30px">
	
	</div>
	
	
	</div>

</body>
</html>